package cn.jboa.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import cn.jboa.base.BaseDaoImpl;
import cn.jboa.dao.IDictionaryDAO;
import cn.jboa.entity.OADictionary;
@Repository
@SuppressWarnings("unchecked")
public class DictionaryDAOImpl extends BaseDaoImpl<OADictionary> implements IDictionaryDAO {
	@Override
	public List<OADictionary> findTopList(Integer parentid) {
		if (parentid==null) {
			return getSession().createQuery(//
					"FROM OADictionary d WHERE d.parent is null")//
					.list();
		}
		return getSession().createQuery(//
				"FROM OADictionary d WHERE d.parent="+parentid)//
				.list();
	}

}
